<?php
//open youtube video url in browser, click on view->page source and copy page source, put the source code of page in temp.txt file that will be loaded in below code.
$file = file_get_contents ('http://www.cometdocs.com/download/1160872-18aa7.txt'); 
preg_match('/(?<=url_encoded_fmt_stream_map"\: ")(.*?)(?=")/',$file,$result);
preg_match('/(?<=(<title>))(.*?)(?=(<\/title>))/',$file,$title);

$data = explode(',',$result[0]);
$i = 1;

foreach ($data as $d)
{

 $t = str_replace("\u0026","&",urldecode($d));
 parse_str($t,$b);
 $a = parse_url($b['url']);
 parse_str($a['query'],$z);
 $b = array_merge($b,$z);
 $url[$i]['type']=$b['type']." = ".$b['quality'];
 $url[$i]['url'] = "http://r4---sn-cvh7zn7d.c.youtube.com/videoplayback?sver={$b['sver']}&ratebypass={$b['ratebypass']}&sparams=cp,id,ip,ipbits,itag,ratebypass,source,upn,expire&mt={$b['mt']}&key={$b['key']}&ip={$b['ip']}&ipbits={$b['ipbits']}&itag={$b['itag']}&source={$b['source']}&upn={$b['upn']}&mv={$b['mv']}&fexp={$b['fexp']}&ms={$b['ms']}&expire={$b['expire']}&id={$b['id']}&cp={$b['cp']}&signature={$b['sig']}&title={$title[0]}";
 $i++;
}
foreach ($url as $v)
{

 echo "<p>{$v['type']} ---- <a href='{$v['url']}' target='_blank'>Click Here To Download</a></p>";
}
?>